package com.testerhome;

import com.testerhome.pages.IndexPage;
import com.testerhome.pages.LoginPage;
import com.testerhome.pages.SelfLogger;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;

/**
 * @author sunliancheng
 * @date 2023/10/22
 */
@Listeners({TestngSelfListener.class})
public class BaseCase {
    public WebDriver webDriver;
    public LoginPage loginPage;
    public IndexPage indexPage;

    @BeforeClass
    public void beforeClass(){
        webDriver = new ChromeDriver();
        loginPage = new LoginPage(webDriver);
        indexPage = new IndexPage(webDriver);
        //不是往threadlocal里面塞值,而是以当前threadlocal为key, new StringBuilder()为value
        //把这个键值对放入当前线程的map里面
        //这个是理解threadlocal的关键点
        SelfLogger.threadLocal.set(new StringBuilder());
    }


}
